import { DataTypes } from 'sequelize';
import { Column, Comment, Index, Model, Table, Unique } from 'sequelize-typescript';

@Table
export class CommandRecord extends Model<CommandRecord> {
  @Comment('用户ID')
  @Index
  @Column({ allowNull: false })
  account_id: string;

  @Comment('站点编号')
  @Column({ type: DataTypes.STRING(500), allowNull: true })
  code: string;

  @Comment('指令')
  @Column({ type: DataTypes.STRING, allowNull: false })
  value: string;

  @Comment('指令是否发送成功')
  @Column({ type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false })
  succeed: boolean;
}
